package elsim.entities

import org.codehaus.groovy.tools.shell.util.Logger

import com.google.common.annotations.VisibleForTesting;

class Passenger {
  private static def LOG = new Logger("Passenger")

  String name
  int to
  int from

  @VisibleForTesting Passenger(String name, int to) {
    this(name, 0, to)
  }

  public Passenger(String name, int from, int to) {
    this.name = name
    this.to = to
    this.from = from
  }

  int distanceFromDestinationTo(int pos) {
    return Math.abs(pos - to)
  }

  protected void setName(String name) {
    this.name = name
  }

  protected void setTo(int destination) {
    this.to = destination
  }

  @Override
  public String toString() {
    return "Passenger [name=" + name + ", to=" + to + ", from=" + from + "]";
  }
}
